package com.atguigu.dga230315.governance.assess.spec;

import com.atguigu.dga230315.governance.assess.Assessor;
import com.atguigu.dga230315.governance.bean.AssessParam;
import com.atguigu.dga230315.governance.bean.GovernanceAssessDetail;
import com.atguigu.dga230315.governance.bean.GovernanceMetric;
import com.atguigu.dga230315.meta.bean.TableMetaInfo;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component("TEC_OWNER")
public class TecOwnerAssess extends Assessor {
    @Override
    protected void assess(GovernanceAssessDetail governanceAssessDetail,AssessParam assessParam) {
        TableMetaInfo tableMetaInfo = assessParam.getTableMetaInfo();
        GovernanceMetric governanceMetric = assessParam.getGovernanceMetric();

        if (tableMetaInfo.getTableMetaInfoExtra().getTecOwnerUserName()==null){
            governanceAssessDetail.setAssessScore(BigDecimal.ZERO);
            governanceAssessDetail.setAssessProblem("没有技术负责人");
            String url = governanceMetric.getGovernanceUrl() + tableMetaInfo.getId();
            governanceAssessDetail.setGovernanceUrl(url);

        }
    }
}
